package com.oha.laporrayelchurro.service;

import java.io.File;
import java.io.IOException;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

public abstract class XlsService {

	/**
	 * 
	 * @return
	 * @throws IOException 
	 * @throws InvalidFormatException 
	 */
	protected Sheet getSheet(String xlsFile) throws InvalidFormatException, IOException{
		File xls = new File(xlsFile);
		Workbook wb = WorkbookFactory.create(xls);
		Sheet sheet = wb.getSheetAt(0);
		return sheet;
	}
	
}
